package com.mifengs.mall.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mifengs.mall.R;
import com.mifengs.mall.entity.TabBean;
import com.mifengs.mall.util.ImageLoadUtil;

import java.util.List;

/**
 * Created by lihaoqi on 2018/4/19.
 */

public class TabClassifyAdapter extends BaseQuickAdapter<TabBean,BaseViewHolder> {



    public TabClassifyAdapter() {
        super(R.layout.item_home_tab);
    }

    @Override
    protected void convert(BaseViewHolder helper, TabBean item) {
        helper.setText(R.id.tab_title,item.getTitle());
        ImageView iconIv = helper.getView(R.id.iv_icon);
        if(TextUtils.isEmpty(item.getImg())){
            ImageLoadUtil.displayFitImage(mContext,item.getIcon(),iconIv);
        }else{
            ImageLoadUtil.displayFitImage(mContext,item.getImg(),iconIv);
        }
    }
}
